' ***^^^***|||***^^^***
' 
'  This file is regenerated until it's edited. Delete the file to force regeneration.

'  NOTE: This denotes the way the file was created and it's possible the 
'        generation type has since changed.
'        Check the generation script for the curent state of the file.

' %%%###%%%9ed4211df86ceda62ac1b1ded820ee18%%%###%%%
' %%%##NoWS##%%%1199e37aa5715232dee21517af998e8a%%%##NoWS##%%%
' ***^^^***|||***^^^***

  
'************************************************************************************
' Copyright © 2003-2006 Kathleen Dollard
'
' This software is provided 'as-is', without any express or implied warranty. In no 
' event will the author be held liable for any damages arising from the use of this
' software.
' 
' You may use this software for any purpose, including commercial applications, 
' and you may redistribute this software as part of application delivery: however, 
' this copyright notice may not be removed and you may not otherwise redistribute 
' this software directly other than providing a link to wwww.gendotnet.com. 
'
' You may alter this software to better server your needs (I'd like to hear about your 
' changes in order to make the software better). If you alter the softwre, you must  
' clearly mark it as altered and must not be misrepresented as the original software.
' nor wholly your original work.
'*************************************************************************************

Option Explicit On
Option Strict On

Imports System
Imports System.Collections.Generic



Public Class MapForeignKey
   Public Function IncludesKey(ByVal propName As String) As Boolean
      For Each key As MapRelationKey In Me.MapRelationKeys
         If String.Compare(propName, key.ChildProperty, True) = 0 Then
            Return True
         End If
      Next
      Return False
   End Function


End Class

Public Class MapForeignKeyCollection
   Public ReadOnly Property CountForKey(ByVal propName As String) As Int32
      Get
         If String.IsNullOrEmpty(propName) Then
            Return 0
         End If
         Dim cnt As Int32
         For Each foreignKey As MapForeignKey In Me
            For Each key As MapRelationKey In foreignKey.MapRelationKeys
               If Not String.IsNullOrEmpty(key.ParentProperty) Then
                  If key.ParentProperty.ToLower = propName.ToLower Then
                     cnt += 1
                  End If
               End If
            Next
         Next
         Return cnt
      End Get
   End Property

End Class

	